﻿using System;
using System.Data.Linq.Mapping;

namespace BSU.CSCE.Data.Model
{
    [Serializable]
    [Table(Name = "Publication")]
    public class Publication : IEntity<int>
    {
        public Publication()
        {
            Id = -1;
        }

        [Column(Name = "id", DbType = "Int IDENTITY", IsPrimaryKey = true,
            IsDbGenerated = true, CanBeNull = false,
            AutoSync = AutoSync.OnInsert, UpdateCheck = UpdateCheck.Never)]
        public int Id { get; set; }

        [Column(Name = "title", DbType = "NVarChar(1000)", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public string Title { get; set; }

        [Column(Name = "shortDescription", DbType = "NVarChar(1000)", CanBeNull = true, UpdateCheck = UpdateCheck.Never)]
        public string ShortDescription { get; set; }

        [Column(Name = "description", DbType = "NVarChar(4000)", CanBeNull = true, UpdateCheck = UpdateCheck.Never)]
        public string Description { get; set; }

        [Column(Name = "type", DbType = "int", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public PublicationType Type { get; set; }

        [Column(Name = "status", DbType = "int", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public PublicationStatus Status { get; set; }

        [Column(Name = "publishingTime", DbType = "DateTime", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        public DateTime PublishingTime { get; set; }
    }
}
